package com.woniuxy01;

/**
 * @author 作者
 * @create 2025-09-02 10:41
 */
public class Test01 {
    public static void main(String[] args) {
        //程序运行中，需要一个学生,使用学生类创建一个学生对象
        //类 对象(变量名)=new 和类名相同的构造方法();
        Student student1=new Student();
        //给学生对象的属性赋值    a.length    数组.属性
        student1.name="zs";
        student1.age=18;
        student1.gender="male";
        //获取学生属性值
        System.out.println(student1.name);
        //调用方法
        System.out.println(student1.show());

        Student student2=new Student();
        student2.name="ls";
        student2.age=19;
        student2.gender="female";
        System.out.println(student2.name);
        System.out.println(student2.show());

        student2=student1;
        student2.name="aaa";
        System.out.println(student1.show());
        System.out.println(student2.show());
    }
}
